home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / orca / punctuation_settings.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  5.4 KB  |  371 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. '''Punctuation Verbosity settings.
  5. The Orca punctuation settings are broken up into 4 modes.
  6.  
  7. These modes are None, Some, Most and All.
  8.  
  9. They are defined by a group of radio buttons on the speech
  10. page of the configuration user interface.
  11.  
  12. Each mode is defined below. The 4 bits of information listed here are:
  13.  
  14.   - The actual printed symbol.
  15.  
  16.   - How the symbol should be pronounced (in the chnames dictionary in
  17.     chnames.py keyed by symbol).
  18.  
  19.   - The level at which the symbol should be spoken. Note that this
  20.     denotes the level containing all lower levels.
  21.  
  22.   - Whether or not the spoken name for the symbol should replace the
  23.     actual symbol or be inserted before the symbol.
  24. '''
  25. __id__ = '$Id: punctuation_settings.py 4411 2009-01-08 15:09:09Z wwalker $'
  26. __version__ = '$Revision: 4411 $'
  27. __date__ = '$Date: 2009-01-08 10:09:09 -0500 (Thu, 08 Jan 2009) $'
  28. __copyright__ = 'Copyright (c) 2005-2008 Sun Microsystems Inc.'
  29. __license__ = 'LGPL'
  30. import settings
  31. PUNCTUATION_REPLACE = 0
  32. PUNCTUATION_INSERT = 1
  33. LEVEL_ALL = settings.PUNCTUATION_STYLE_ALL
  34. LEVEL_MOST = settings.PUNCTUATION_STYLE_MOST
  35. LEVEL_SOME = settings.PUNCTUATION_STYLE_SOME
  36. LEVEL_NONE = settings.PUNCTUATION_STYLE_NONE
  37. middle_dot = u'¬∑'
  38. bullet = u'‚Ä¢'
  39. triangular_bullet = u'‚Ä£'
  40. hyphen_bullet = u'‚ÅÉ'
  41. black_square = u'‚ñ†'
  42. white_square = u'‚ñ°'
  43. white_bullet = u'‚ó¶'
  44. white_circle = u'‚óã'
  45. black_diamond = u'‚óÜ'
  46. black_circle = u'‚óè'
  47. check_mark = u'‚úì'
  48. heavy_check_mark = u'‚úî'
  49. x_shaped_bullet = u'‚úó'
  50. right_arrow = u'‚ûî'
  51. right_arrowhead = u'‚û¢'
  52. SO_black_square = u'ÓÄä'
  53. SO_black_diamond = u'ÓÄå'
  54. cent = u'¬¢'
  55. pound = u'¬£'
  56. yen = u'¬•'
  57. section = u'¬ß'
  58. copyright_sign = u'¬©'
  59. not_sign = u'¬¨'
  60. registered = u'¬Æ'
  61. degree = u'¬∞'
  62. plus_minus = u'¬±'
  63. superscript2 = u'¬≤'
  64. superscript3 = u'¬≥'
  65. one_quarter = u'¬º'
  66. one_half = u'¬Ω'
  67. three_quarters = u'¬æ'
  68. multiply = u'√ó'
  69. divide = u'√∑'
  70. en_dash = u'‚Äì'
  71. left_single_quote = u'‚Äò'
  72. right_single_quote = u'‚Äô'
  73. single_low_quote = u'‚Äö'
  74. left_double_quote = u'‚Äú'
  75. right_double_quote = u'‚Äù'
  76. double_low_quote = u'‚Äû'
  77. dagger = u'‚Ć'
  78. double_dagger = u'‚İ'
  79. per_mille = u'‚Ä∞'
  80. prime = u'‚Ä≤'
  81. double_prime = u'‚Ä≥'
  82. euro = u'‚Ǩ'
  83. trademark = u'‚Ñ¢'
  84. infinity = u'‚àû'
  85. almost_equal = u'‚âà'
  86. not_equal = u'‚â†'
  87. lt_or_equal = u'‚â§'
  88. gt_or_equal = u'‚â•'
  89. square_root = u'‚àö'
  90. cube_root = u'‚àõ'
  91. punctuation = { }
  92. punctuation['!'] = [
  93.     LEVEL_ALL,
  94.     PUNCTUATION_INSERT]
  95. punctuation["'"] = [
  96.     LEVEL_ALL,
  97.     PUNCTUATION_REPLACE]
  98. punctuation[','] = [
  99.     LEVEL_ALL,
  100.     PUNCTUATION_INSERT]
  101. punctuation['.'] = [
  102.     LEVEL_ALL,
  103.     PUNCTUATION_INSERT]
  104. punctuation['?'] = [
  105.     LEVEL_ALL,
  106.     PUNCTUATION_INSERT]
  107. punctuation[right_single_quote] = [
  108.     LEVEL_ALL,
  109.     PUNCTUATION_REPLACE]
  110. punctuation['"'] = [
  111.     LEVEL_MOST,
  112.     PUNCTUATION_REPLACE]
  113. punctuation['('] = [
  114.     LEVEL_MOST,
  115.     PUNCTUATION_REPLACE]
  116. punctuation[')'] = [
  117.     LEVEL_MOST,
  118.     PUNCTUATION_REPLACE]
  119. punctuation['-'] = [
  120.     LEVEL_MOST,
  121.     PUNCTUATION_REPLACE]
  122. punctuation['_'] = [
  123.     LEVEL_MOST,
  124.     PUNCTUATION_REPLACE]
  125. punctuation[':'] = [
  126.     LEVEL_MOST,
  127.     PUNCTUATION_INSERT]
  128. punctuation[';'] = [
  129.     LEVEL_MOST,
  130.     PUNCTUATION_INSERT]
  131. punctuation['<'] = [
  132.     LEVEL_MOST,
  133.     PUNCTUATION_REPLACE]
  134. punctuation['>'] = [
  135.     LEVEL_MOST,
  136.     PUNCTUATION_REPLACE]
  137. punctuation['['] = [
  138.     LEVEL_MOST,
  139.     PUNCTUATION_REPLACE]
  140. punctuation[']'] = [
  141.     LEVEL_MOST,
  142.     PUNCTUATION_REPLACE]
  143. punctuation['\\'] = [
  144.     LEVEL_MOST,
  145.     PUNCTUATION_REPLACE]
  146. punctuation['|'] = [
  147.     LEVEL_MOST,
  148.     PUNCTUATION_REPLACE]
  149. punctuation['`'] = [
  150.     LEVEL_MOST,
  151.     PUNCTUATION_REPLACE]
  152. punctuation['~'] = [
  153.     LEVEL_MOST,
  154.     PUNCTUATION_REPLACE]
  155. punctuation['{'] = [
  156.     LEVEL_MOST,
  157.     PUNCTUATION_REPLACE]
  158. punctuation['}'] = [
  159.     LEVEL_MOST,
  160.     PUNCTUATION_REPLACE]
  161. punctuation[left_single_quote] = [
  162.     LEVEL_MOST,
  163.     PUNCTUATION_REPLACE]
  164. punctuation[left_double_quote] = [
  165.     LEVEL_MOST,
  166.     PUNCTUATION_REPLACE]
  167. punctuation[right_double_quote] = [
  168.     LEVEL_MOST,
  169.     PUNCTUATION_REPLACE]
  170. punctuation[en_dash] = [
  171.     LEVEL_MOST,
  172.     PUNCTUATION_REPLACE]
  173. punctuation[double_low_quote] = [
  174.     LEVEL_MOST,
  175.     PUNCTUATION_REPLACE]
  176. punctuation[single_low_quote] = [
  177.     LEVEL_MOST,
  178.     PUNCTUATION_REPLACE]
  179. punctuation['#'] = [
  180.     LEVEL_SOME,
  181.     PUNCTUATION_REPLACE]
  182. punctuation['$'] = [
  183.     LEVEL_SOME,
  184.     PUNCTUATION_REPLACE]
  185. punctuation['%'] = [
  186.     LEVEL_SOME,
  187.     PUNCTUATION_REPLACE]
  188. punctuation['&'] = [
  189.     LEVEL_SOME,
  190.     PUNCTUATION_REPLACE]
  191. punctuation['*'] = [
  192.     LEVEL_SOME,
  193.     PUNCTUATION_REPLACE]
  194. punctuation['+'] = [
  195.     LEVEL_SOME,
  196.     PUNCTUATION_REPLACE]
  197. punctuation['/'] = [
  198.     LEVEL_SOME,
  199.     PUNCTUATION_REPLACE]
  200. punctuation['='] = [
  201.     LEVEL_SOME,
  202.     PUNCTUATION_REPLACE]
  203. punctuation['@'] = [
  204.     LEVEL_SOME,
  205.     PUNCTUATION_REPLACE]
  206. punctuation['^'] = [
  207.     LEVEL_SOME,
  208.     PUNCTUATION_REPLACE]
  209. punctuation[cent] = [
  210.     LEVEL_SOME,
  211.     PUNCTUATION_REPLACE]
  212. punctuation[pound] = [
  213.     LEVEL_SOME,
  214.     PUNCTUATION_REPLACE]
  215. punctuation[yen] = [
  216.     LEVEL_SOME,
  217.     PUNCTUATION_REPLACE]
  218. punctuation[euro] = [
  219.     LEVEL_SOME,
  220.     PUNCTUATION_REPLACE]
  221. punctuation[not_sign] = [
  222.     LEVEL_SOME,
  223.     PUNCTUATION_REPLACE]
  224. punctuation[copyright_sign] = [
  225.     LEVEL_SOME,
  226.     PUNCTUATION_REPLACE]
  227. punctuation[registered] = [
  228.     LEVEL_SOME,
  229.     PUNCTUATION_REPLACE]
  230. punctuation[trademark] = [
  231.     LEVEL_SOME,
  232.     PUNCTUATION_REPLACE]
  233. punctuation[degree] = [
  234.     LEVEL_SOME,
  235.     PUNCTUATION_REPLACE]
  236. punctuation[plus_minus] = [
  237.     LEVEL_SOME,
  238.     PUNCTUATION_REPLACE]
  239. punctuation[multiply] = [
  240.     LEVEL_SOME,
  241.     PUNCTUATION_REPLACE]
  242. punctuation[divide] = [
  243.     LEVEL_SOME,
  244.     PUNCTUATION_REPLACE]
  245. punctuation[infinity] = [
  246.     LEVEL_SOME,
  247.     PUNCTUATION_REPLACE]
  248. punctuation[almost_equal] = [
  249.     LEVEL_SOME,
  250.     PUNCTUATION_REPLACE]
  251. punctuation[not_equal] = [
  252.     LEVEL_SOME,
  253.     PUNCTUATION_REPLACE]
  254. punctuation[lt_or_equal] = [
  255.     LEVEL_SOME,
  256.     PUNCTUATION_REPLACE]
  257. punctuation[gt_or_equal] = [
  258.     LEVEL_SOME,
  259.     PUNCTUATION_REPLACE]
  260. punctuation[square_root] = [
  261.     LEVEL_SOME,
  262.     PUNCTUATION_REPLACE]
  263. punctuation[cube_root] = [
  264.     LEVEL_SOME,
  265.     PUNCTUATION_REPLACE]
  266. punctuation[dagger] = [
  267.     LEVEL_SOME,
  268.     PUNCTUATION_REPLACE]
  269. punctuation[double_dagger] = [
  270.     LEVEL_SOME,
  271.     PUNCTUATION_REPLACE]
  272. punctuation[section] = [
  273.     LEVEL_SOME,
  274.     PUNCTUATION_REPLACE]
  275. punctuation[prime] = [
  276.     LEVEL_SOME,
  277.     PUNCTUATION_REPLACE]
  278. punctuation[double_prime] = [
  279.     LEVEL_SOME,
  280.     PUNCTUATION_REPLACE]
  281. punctuation[per_mille] = [
  282.     LEVEL_SOME,
  283.     PUNCTUATION_REPLACE]
  284. punctuation[middle_dot] = [
  285.     LEVEL_NONE,
  286.     PUNCTUATION_REPLACE]
  287. punctuation[bullet] = [
  288.     LEVEL_NONE,
  289.     PUNCTUATION_REPLACE]
  290. punctuation[triangular_bullet] = [
  291.     LEVEL_NONE,
  292.     PUNCTUATION_REPLACE]
  293. punctuation[hyphen_bullet] = [
  294.     LEVEL_NONE,
  295.     PUNCTUATION_REPLACE]
  296. punctuation[black_square] = [
  297.     LEVEL_NONE,
  298.     PUNCTUATION_REPLACE]
  299. punctuation[white_square] = [
  300.     LEVEL_NONE,
  301.     PUNCTUATION_REPLACE]
  302. punctuation[white_bullet] = [
  303.     LEVEL_NONE,
  304.     PUNCTUATION_REPLACE]
  305. punctuation[white_circle] = [
  306.     LEVEL_NONE,
  307.     PUNCTUATION_REPLACE]
  308. punctuation[black_diamond] = [
  309.     LEVEL_NONE,
  310.     PUNCTUATION_REPLACE]
  311. punctuation[black_circle] = [
  312.     LEVEL_NONE,
  313.     PUNCTUATION_REPLACE]
  314. punctuation[check_mark] = [
  315.     LEVEL_NONE,
  316.     PUNCTUATION_REPLACE]
  317. punctuation[heavy_check_mark] = [
  318.     LEVEL_NONE,
  319.     PUNCTUATION_REPLACE]
  320. punctuation[x_shaped_bullet] = [
  321.     LEVEL_NONE,
  322.     PUNCTUATION_REPLACE]
  323. punctuation[right_arrow] = [
  324.     LEVEL_NONE,
  325.     PUNCTUATION_REPLACE]
  326. punctuation[right_arrowhead] = [
  327.     LEVEL_NONE,
  328.     PUNCTUATION_REPLACE]
  329. punctuation[SO_black_square] = [
  330.     LEVEL_NONE,
  331.     PUNCTUATION_REPLACE]
  332. punctuation[SO_black_diamond] = [
  333.     LEVEL_NONE,
  334.     PUNCTUATION_REPLACE]
  335. punctuation[one_quarter] = [
  336.     LEVEL_NONE,
  337.     PUNCTUATION_REPLACE]
  338. punctuation[one_half] = [
  339.     LEVEL_NONE,
  340.     PUNCTUATION_REPLACE]
  341. punctuation[three_quarters] = [
  342.     LEVEL_NONE,
  343.     PUNCTUATION_REPLACE]
  344. punctuation[superscript3] = [
  345.     LEVEL_NONE,
  346.     PUNCTUATION_REPLACE]
  347. punctuation[superscript2] = [
  348.     LEVEL_NONE,
  349.     PUNCTUATION_REPLACE]
  350.  
  351. def getPunctuationInfo(character):
  352.     '''Given a punctuation character, return the value
  353.     [punctuation_style, punctuation_action] or None
  354.  
  355.     Arguments:
  356.     - character: the punctuation character to get the information for
  357.  
  358.     Returns return the value [punctuation_style, punctuation_action]
  359.     or None
  360.     '''
  361.     if not isinstance(character, unicode):
  362.         character = character.decode('UTF-8')
  363.     
  364.     
  365.     try:
  366.         return punctuation[character]
  367.     except:
  368.         return None
  369.  
  370.  
  371.